package com.linxi.rpccompensation.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.linxi.rpccompensation.entity.SysPushLog;

/**
 * 日志推送service，对外服务定义
 *
 * @author admin
 */
public interface PushLogService extends IService<SysPushLog> {

	/**
	 * 保存 url、参数
	 *
	 * @param api
	 * @param data
	 * @return
	 */
	String savePushLog(String api, String data);

	/**
	 * 根据id修改成功状态
	 *
	 * @param id
	 * @return
	 */
	void updateSuccess(String id);

	/**
	 * 根据id修改失败状态
	 *
	 * @param id
	 * @return
	 */
	void updateFail(String id);

	/**
	 * 推送
	 *
	 * @param pushLog
	 * @throws Exception
	 */
	void doPushTask(SysPushLog pushLog) throws Exception;

	/**
	 * 通用推送
	 *
	 * @param api
	 * @param pushLog
	 * @return
	 * @throws Exception
	 */
	boolean doPush(String api, String pushLog) throws Exception;
}
